//package com.inspur.edp.bef.dtgenerator.core.rtgen.entitygen.method;
//
//import com.inspur.edp.bef.dtgenerator.core.rtgen.entitygen.BefRtEntityGenCtx;
//import com.inspur.edp.bef.spi.entity.IDefaultValueDic;
//import com.inspur.edp.caf.generator.baseInfo.ParameterInfo;
//import com.inspur.edp.caf.generator.baseInfo.TypeInfo;
//import com.inspur.edp.caf.generator.method.ClassMethodGenerator;
//import com.inspur.edp.cef.entity.config.CefConfig;
//import com.inspur.edp.cef.entity.config.MgrConfig;
//import com.inspur.edp.cef.rtgenerator.utils.GeneratorUtil;
//import org.eclipse.jdt.core.dom.*;
//
//import java.util.ArrayList;
//
//public class GetDefaultValueDicGenerator extends ClassMethodGenerator
//{
//	private BefRtEntityGenCtx ctx;
//	public GetDefaultValueDicGenerator(BefRtEntityGenCtx ctx)
//	{
//		this.ctx = ctx;
//	}
//
//	//return (IDefaultValueDic)Class.forName("aaa").getConstructor(null).newInstance(null);
//	@Override
//	protected Block buildMethodBody() {
//		Block block = ast.newBlock();
//		ReturnStatement returnStatement = ast.newReturnStatement();
//		returnStatement.setExpression(ast.newNullLiteral());
//		block.statements().add(returnStatement);
//		return block;
//		//TODO: java版临时注释 默认值优先级低
////		CefConfig cefConfig = ctx.getProjContext().getCefConfig();
////		MgrConfig mgrConfig = cefConfig.getMgrConfig();
////		String mgrAseemblyName = mgrConfig.getImpAssembly();
////		//TODO: 默认值现在的实现, 不支持udt等, 运行时反射性能不好, 临时改一下将来重新做吧.
////		String nameSpace = mgrConfig.getImpClass().substring(0, mgrConfig.getImpClass().lastIndexOf('.'));
////		String mgrClassName = nameSpace + "." + "DefaultValueUtil";
////
////		Block block=ast.newBlock();
////		ReturnStatement returnStatement=ast.newReturnStatement();
////		CastExpression castExpression=ast.newCastExpression();
////		castExpression.setType(new com.inspur.edp.caf.generator.baseInfo.TypeInfo(IDefaultValueDic.class).getType(ast));
////		MethodInvocation methodInvocationNewInstance =ast.newMethodInvocation();
////		methodInvocationNewInstance.setName(ast.newSimpleName("newInstance"));
////		methodInvocationNewInstance.arguments().add(ast.newNullLiteral());
////		addNewInstanceExpression(methodInvocationNewInstance,mgrClassName);
////		castExpression.setExpression(methodInvocationNewInstance);
////		returnStatement.setExpression(castExpression);
////		block.statements().add(returnStatement);
////		return block;
//	}
//
//	private void addNewInstanceExpression(MethodInvocation methodInvocationNewInstance, String mgrClassName) {
//		MethodInvocation methodInvocationGetConstructor=ast.newMethodInvocation();
//		methodInvocationGetConstructor.setName(ast.newSimpleName("getConstructor"));
//		methodInvocationGetConstructor.arguments().add(ast.newNullLiteral());
//		addNewConstructExpression(methodInvocationGetConstructor,mgrClassName);
//
//		methodInvocationNewInstance.setExpression(methodInvocationGetConstructor);
//	}
//
//	private void addNewConstructExpression(MethodInvocation methodInvocationGetConstructor, String mgrClassName) {
//		MethodInvocation methodInvocationForName =ast.newMethodInvocation();
//		methodInvocationForName.setExpression(ast.newName(Class.class.getTypeName()));
//		methodInvocationForName.setName(ast.newSimpleName("forName"));
//		methodInvocationForName.arguments().add(ExpressionUtils.getStringLiteral(ast,mgrClassName));
//
//		methodInvocationGetConstructor.setExpression(methodInvocationForName);
//	}
//
//	private java.lang.Class getDicType() throws ClassNotFoundException {
//		CefConfig cefConfig = ctx.befGenCtx.getCefConfig();
//		MgrConfig mgrConfig = cefConfig.getMgrConfig();
//		String mgrAseemblyName = mgrConfig.getImpAssembly();
//		String mgrClassName = mgrAseemblyName+"."+"DefaultValueUtil";
//		java.lang.Class dicType =Class.forName(mgrClassName);
//		return dicType;
//	}
//
//	@Override
//	protected boolean getIsOverride() {
//		return true;
//	}
//
//	@Override
//	protected java.util.ArrayList<Modifier.ModifierKeyword> getAccessModifiers()
//	{
//		return new java.util.ArrayList<Modifier.ModifierKeyword>(java.util.Arrays.asList(new Modifier.ModifierKeyword[] { Modifier.ModifierKeyword.PUBLIC_KEYWORD}));
//	}
//
//	@Override
//	protected String getMethodName()
//	{
//		return "getDefaultValueDic";
//	}
//
//	@Override
//	protected ArrayList<ParameterInfo> getParameterCollection() {
//		return new java.util.ArrayList<ParameterInfo>(java.util.Arrays.asList(new ParameterInfo[] { }));
//	}
//
//	@Override
//	protected TypeInfo getReturnType() {
//		return new TypeInfo(IDefaultValueDic.class);
//	}
//}